package cn.dhnep.demo.controller;

import cn.dhnep.demo.pojo.Result;
import cn.dhnep.demo.pojo.User;
import cn.dhnep.demo.service.DistributionService;
import io.swagger.annotations.Api;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.*;

import java.util.List;

/**
 * @Author 邱文彬
 * @Date 2021/11/8 16:16
 * @Version 1.0
 */


@Controller
@ResponseBody
@CrossOrigin
@Api("用户信息")
public class obtainUserController {

    @Autowired
    private DistributionService distributionService;


//    获取用户推广的用户信息
    @RequestMapping(value = "Distribution",method = RequestMethod.POST)
    public Result QueryuserOneDistribution (@RequestParam("openId") String openId){
        List<User> user = distributionService.QueryuserOneDistribution(openId);


        return new Result(0,"获取成功",user);
    }
}
